<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button id="btn">click</button>
    <script>
        let btn = document.getElementById('btn');
        let click1 = () => {

            console.log('L1');
            Promise.resolve().then(() => { console.log('M1') });
        }
        btn.addEventListener('click', click1);
        let click2 = () => {

            console.log('L2');
            Promise.resolve().then(() => { console.log('M2') });
        };
        btn.addEventListener('click', click2);
        //什么进入检查点，清空微任务 当前调栈清空的时候
        btn.click();//==> click1();click2();
        console.log('a');

    </script>
</body>

</html>